<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>标书制作管理</title>
	<meta name="decorator" content="default"/>
	<link rel="stylesheet" href="${ctxStatic}/common/bootstrap.min.css">
	<link rel="stylesheet" href="${ctxStatic}/common/AdminLTE.min.css">
	<link rel="stylesheet" href="${ctxStatic}/common/jeesite.css">
	<script src="${ctxStatic}/jquery-validation/1.16/jquery.validate.js"></script>
	<script src="${ctxStatic}/jquery-validation/1.16/jquery.validate.extend.js"></script>
	<script src="${ctxStatic}/jquery-validation/1.16/localization/messages_zh_CN.js"></script>
	<style type="text/css">
		
	</style>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			$("#btnRes").click(function(){
				top.$.jBox.confirm("确认要提交终稿标书吗？","系统提示",function(v,h,f){
					if(v == "ok"){
						$("#tenderFlag").val("1");
						$("#inputForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
			$("[data-toggle='popover']").popover();
		});
		
		function proInfoFn(){
			
		}
		
	</script>
</head>
<body>
	
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/zx/makeTender/list">标书制作列表</a></li>
		<li class="active"><a href="${ctx}/zx/makeTender/form?lzdId=${makeTender.lzdId}&sectionId=${makeTender.sectionId}">标书制作</a></li>
	</ul>
	<div class="main-content">
	  <div class="box box-main">
	  	
	  	<form:form id="inputForm" modelAttribute="makeTender" action="${ctx}/zx/makeTender/save" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<form:hidden path="lzdId"/>
			<form:hidden path="sectionId"/>
			<form:hidden path="tenderFlag"/>
			<sys:message content="${message}"/>	
			<div class="box-body">
				<!-- 项目详情 -->
				<div id="proInfo1">
					<div class="form-unit">项目基本信息 
						<span style="float: right">
							<a href="${ctx}/zx/all/lzd/getLzdAllInfo?lzdId=${makeTender.lzdId}&sectionId=${makeTender.sectionId}&pageFlag=makeTender"> 查看更多项目详情>></a>
						</span>
					</div>
					<div class="row">
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 项目名称：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="lzd.proName" maxlength="100" class="form-control required" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 项目负责人：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="lzd.proPic" maxlength="100" class="form-control" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 标书完成时间：<i class="fa icon-question hide"></i>
								</label>
								<div class="col-sm-8">
									<input type="text" disabled="true" maxlength="20"  style="width:100%;height:30px" class="form-control"
										value="<fmt:formatDate value="${makeTender.lzd.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>" />
					
								</div>
							</div>
						</div>
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 采购单位：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="lzd.buyUnit" maxlength="255" class="form-control" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 项目参数文件：<i class="fa   icon-question hide"></i>
								</label>
								<div class="col-sm-8">
									<form:hidden id="proParamFile" path="lzd.proParamFile" htmlEscape="false" maxlength="100" class="input-xlarge"/>
									<sys:ckfinder input="proParamFile" type="files" readonly="true" uploadPath="/zx/proParamFile" selectMultiple="true"/>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- 标段信息 -->
				<c:if test="${makeTender.lzd.isSubpackage eq '1'}">
					<div class="form-unit">标段信息</div>
					<div class="row">
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 标段名称：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="section.sectionName" maxlength="100" class="form-control required" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 项目预算(<font style="color: red">万元</font>)：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="section.budgetMoney" maxlength="100" class="form-control" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 折扣：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="section.discount" maxlength="100" class="form-control required" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
						<%-- <div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 保证金：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="section.earnestMoney" maxlength="100" class="form-control" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div> --%>
					</div>
				</c:if>
				
				<!-- ---------------分割符-------------------->
				<div class="form-unit">标书制作信息</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> 项目编码：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<input name="proNo" value="${makeTender.lzd.proNo}" maxlength="100" class="form-control required zx-input" style="height:30px;border-radius: 4px;">
								<%-- <form:input path="proNo" maxlength="100" class="form-control required" cssStyle="height:30px"/> --%>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> 标书制作人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:input path="makeTenderBy" maxlength="100" class="form-control required" cssStyle="height:30px"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> 审核人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:input path="auditor" maxlength="100" class="form-control required" cssStyle="height:30px"/>
							</div>
						</div>
					</div>
					<%-- <div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> 保证金金额：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:input path="depositMoney" maxlength="100" class="form-control required number" cssStyle="height:30px"/>
							</div>
						</div>
					</div> --%>
					<%-- <div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> 项目执行人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:input path="proPerformer" maxlength="100" class="form-control required" cssStyle="height:30px"/>
							</div>
						</div>
					</div> --%>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> 备注信息：<i class="fa icon-question hide"></i>
							</label>
							<div class="col-sm-10">
								<form:textarea path="remarks" rows="3" maxlength="500" class="form-control" cssStyle="border-radius: 4px;"/>
							</div>
						</div>
					</div>
				</div>
				<div class="form-unit">上传标书文件<span class="label label-success" style="margin-left: 5px;font-weight: 400;">标书最多只能上传5次</span></div>
				<c:forEach items="${makeTender.fileList}" var="e" varStatus="st">
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">							
								<div class="col-sm-8" style="margin-left: 60px">
									<input type="hidden" id="fileIndex" value="${fn:length(fileList)}"/>
									<form:hidden path="fileList[${st.index}].id" />
									<form:hidden id="tenderFile${st.index}" path="fileList[${st.index}].fileUrl" htmlEscape="false" maxlength="100" class="input-xlarge"/>
									<sys:ckfinder input="tenderFile${st.index}" type="files" uploadPath="/zx/tenderFile" selectMultiple="false" readonly="${makeTender.tenderFlag eq '1' ? true : false}"/>
									<c:if test="${not empty e.createDate}">
										<span class="label label-success" style="margin-left: 5px;font-size: 90%;font-weight: 400;">上传时间：<fmt:formatDate value="${e.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
									</c:if>	
									<c:if test="${e.auditState eq '1'}">								
										<span class="label label-success" style="margin-left: 5px;font-size: 90%;font-weight: 400;">审核时间：<fmt:formatDate value="${e.auditDate}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
										<span class="label label-success" style="margin-left: 5px;font-size: 90%;font-weight: 400;">审核通过</span>
									</c:if>
									<c:if test="${e.auditState eq '2'}">
										<span class="label label-success" style="margin-left: 5px;font-size: 90%;font-weight: 400;">审核时间：<fmt:formatDate value="${e.auditDate}" pattern="yyyy-MM-dd HH:mm:ss"/></span>										
										<span class="label label-danger" title="不通过原因" style="margin-left: 5px;font-size: 90%;font-weight: 400;cursor:pointer" data-container="body" data-toggle="popover" data-placement="top" data-content="${e.auditContent}">未通过审核</span>	
									</c:if>							
								</div>
								
							</div>
						</div>
					</div>
					<c:if test="${st.index != 4}">
						<div class="control-group"  style="padding-bottom:0px"></div>
					</c:if>
				</c:forEach>

				<div class="form-actions" style="background-color: #fff">
					<shiro:hasPermission name="zx:makeTender:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
					<c:if test="${makeTender.tenderFlag eq '0' || empty makeTender.tenderFlag}">
						<shiro:hasPermission name="zx:makeTender:edit"><input id="btnRes" class="btn btn-danger" type="button" value="提交终稿标书"/>&nbsp;</shiro:hasPermission>
					</c:if>
					<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)" style="background-color: #e7e7e7;"/>
				</div>
			</div>
		</form:form>
	  </div>
	</div>
</body>
</html>